﻿using WebApiClientCore;
using WebApiClientCore.Attributes;
using BPM.Web.Shared.Data;
using BPM.Web.Shared.Auth;

namespace BPM.Web.Shared.Service;

[TokenFilter]
public interface IPosClient : IHttpApi
{
    /// <summary>
    /// 分页获取职位
    /// </summary>
    /// <param name="body"></param>
    /// <param name="token"></param>
    /// <returns></returns>
    [HttpGet("sysPos/page")]
    ITask<XnRestfulResult<PageResult<SysPos>>> PageAsync(PosPageInput body, CancellationToken token = default);

    /// <summary>
    /// 获取职位列表
    /// </summary>
    /// <param name="body"></param>
    /// <param name="token"></param>
    /// <returns></returns>
    [HttpGet("sysPos/list")]
    ITask<XnRestfulResult<List<SysPos>>> ListAsync(PosInput body, CancellationToken token = default);

    /// <summary>
    /// 增加职位
    /// </summary>
    /// <param name="body"></param>
    /// <param name="token"></param>
    /// <returns></returns>
    [HttpPost("sysPos/add")]
    ITask<XnRestfulResult<string>> AddAsync(AddPosInput body, CancellationToken token = default);

    /// <summary>
    /// 删除职位
    /// </summary>
    /// <param name="body"></param>
    /// <param name="token"></param>
    /// <returns></returns>
    [HttpPost("sysPos/delete")]
    ITask<XnRestfulResult<string>> DeleteAsync(DeletePosInput body, CancellationToken token = default);

    /// <summary>
    /// 更新职位
    /// </summary>
    /// <param name="body"></param>
    /// <param name="token"></param>
    /// <returns></returns>
    [HttpPost("sysPos/edit")]
    ITask<XnRestfulResult<string>> EditAsync(UpdatePosInput body, CancellationToken token = default);

    /// <summary>
    /// 获取职位
    /// </summary>
    /// <param name="body"></param>
    /// <param name="id"></param>
    /// <param name="token"></param>
    /// <returns></returns>
    [HttpGet("sysPos/detail")]
    ITask<XnRestfulResult<SysPos>> DetailAsync(QueryPosInput body, CancellationToken token = default);
}
